<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>商家管理后台</title>
	<link type="image/x-icon" href="<?php echo IUrl::creatUrl("")."favicon.ico";?>" rel="icon">
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/jquery/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artdialog/artDialog.js?v=20200606"></script><script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artdialog/plugins/iframeTools.js?v=2023"></script><link rel="stylesheet" type="text/css" href="/runtime/_systemjs/artdialog/skins/white.css" />
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/form/form.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artTemplate/artTemplate.js"></script><script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/artTemplate/artTemplate-plugin.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/autovalidate/validate.js?v=20200606"></script><link rel="stylesheet" type="text/css" href="/runtime/_systemjs/autovalidate/style.css" />
	<script type="text/javascript" charset="UTF-8" src="/runtime/_systemjs/cookie/jquery.cookie.js"></script>
	<script type='text/javascript' src="<?php echo $this->getWebViewPath()."javascript/html5.js";?>"></script>
	<!--[if lt IE 9]>
	<link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."css/ie.css";?>" type="text/css" media="screen" />
	<![endif]-->
	<link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."css/admin.css";?>" type="text/css" media="screen" />
	<script type='text/javascript' src="<?php echo IUrl::creatUrl("")."public/javascript/public.js";?>"></script>
	<?php $seller_id = $this->seller['seller_id'];$seller_name = $this->seller['seller_name'];?>
</head>

<body>
	<!--头部 开始-->
	<header id="header">
		<nav class="navbar">
			<div class="container-fluid">
				<div class="navbar-holder d-flex align-items-center justify-content-between">
					<div class="navbar-header">
						<h1 class="site_title">
						    <a href="<?php echo IUrl::creatUrl("/seller/index");?>"><?php echo $this->_siteConfig->name;?>商家管理</a>
						</h1>
					</div>

					<ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center">
						<li class="nav-item"><a class="nav-link" href="<?php echo IUrl::creatUrl("");?>" target="_blank">网站首页</a></li>
						<li class="nav-item"><a class="nav-link" href="<?php echo IUrl::creatUrl("/site/home/id/".$seller_id."");?>" target="_blank">商家主页</a></li>
						<li class="nav-item"><a class="nav-link" href="<?php echo IUrl::creatUrl("/systemseller/logout");?>">退出登录</a></li>
					</ul>
				</div>
			</div>
		</nav>
	</header>
	<!--头部 结束-->

	<div class="page-content d-flex align-items-stretch">
		<!--侧边栏菜单 开始-->
		<nav id="sidebar" class="side-navbar">
			<ul class="list-unstyled">
				<?php foreach($items=menuSeller::init() as $key => $item){?>
				<li>
				    <a href="#<?php echo isset($key)?$key:"";?>" aria-expanded="false" data-toggle="collapse" name="menuItems" title="<?php echo isset($key)?$key:"";?>">
				        <i class=""></i> <?php echo isset($key)?$key:"";?>
				    </a>

					<ul id="<?php echo isset($key)?$key:"";?>" name="leftMenu" class="collapse list-unstyled" data-parent="#sidebar">
						<?php foreach($items=$item as $moreKey => $moreValue){?>
						<li><a href="<?php echo IUrl::creatUrl("".$moreKey."");?>"><?php echo isset($moreValue)?$moreValue:"";?></a></li>
						<?php }?>
					</ul>
				</li>
				<?php }?>
			</ul>
		</nav>
		<!--侧边栏菜单 结束-->

		<!--主体内容 开始-->
		<section class="content-inner">
			<article class="col-lg-12">
	<div class="card forms">
		<div class="card-header d-flex align-items-center justify-content-between">
			<h3>自提点</h3>
			<div>
				<input type="button" class="btn btn-primary" onclick="window.location.href='<?php echo IUrl::creatUrl("/seller/takeself_edit");?>';" value="添加" />
				<input type="button" class="btn btn-primary" onclick="selectAll('id[]')" value="全选" />
				<input type="button" class="btn btn-primary" onclick="delModel();" value="批量删除" />
			</div>
		</div>

		<div class="card-body">
			<form action="<?php echo IUrl::creatUrl("/seller/takeself_operate");?>" method="post" class="form-horizontal">
				<table class="table">
					<colgroup>
						<col width="40px" />
						<col width="150px" />
						<col />
					</colgroup>

					<thead>
						<tr>
							<th></th>
							<th>名称</th>
							<th>区域</th>
							<th>地址</th>
							<th>固定电话</th>
							<th>手机</th>
							<th>排序</th>
							<th>操作</th>
						</tr>
					</thead>

					<tbody>
						<?php $queryObj=Api::run('getListByTakeself');$resultData=$queryObj->find()?>
						<?php foreach($items=$resultData as $key => $item){?>
						<tr>
							<td><input name="id[]" class="checkbox-template" type="checkbox" value="<?php echo isset($item['id'])?$item['id']:"";?>" /></td>
							<td><?php echo isset($item['name'])?$item['name']:"";?></td>
							<td><?php echo isset($item['area_name'])?$item['area_name']:"";?></td>
							<td><?php echo isset($item['address'])?$item['address']:"";?></td>
							<td><?php echo isset($item['phone'])?$item['phone']:"";?></td>
							<td><?php echo isset($item['mobile'])?$item['mobile']:"";?></td>
							<td><?php echo isset($item['sort'])?$item['sort']:"";?></td>
							<td>
								<a href="<?php echo IUrl::creatUrl("/seller/takeself_edit/id/".$item['id']."");?>"><i class="fa fa-edit fa-lg" title="编辑"></i></a>
								<a href="javascript:delModel({link:'<?php echo IUrl::creatUrl("/seller/takeself_operate/id/".$item['id']."");?>'})"><i class="fa fa-close fa-lg" title="删除"></i></a>
							</td>
						</tr>
						<?php }?>
					</tbody>
				</table>
			</form>
			<?php echo $queryObj->getPageBar();?>
		</div>
	</div>
</article>
		</section>
		<!--主题内容 结束-->
	</div>

	<script src="<?php echo IUrl::creatUrl("")."public/javascript/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js";?>"></script>
	<script src="<?php echo IUrl::creatUrl("")."public/javascript/twitter-bootstrap/4.1.3/js/bootstrap.min.js";?>"></script>

	<script type="text/javascript">
	//菜单图片ICO配置
	function menuIco(val)
	{
		var icoConfig = {
			"统计结算模块" : "fa fa-bar-chart-o",
			"商品模块" : "fa fa-inbox",
			"订单模块" : "fa fa-file-text",
			"营销模块" : "fa fa-bullhorn",
			"配置模块" : "fa fa-gears"
		};
		return icoConfig[val] ? icoConfig[val] : "fa fa-list";
	}

	$("[name='menuItems']").each(function()
	{
		$(this).find("i").addClass(menuIco($(this).attr('title')));
	});

    //兼容IE系列
    $("[name='leftMenu'] [href^='javascript:']").each(function(i)
    {
    	var fun = $(this).attr('href').replace("javascript:","");
    	$(this).attr('href','javascript:void(0)');
    	$(this).on("click",function(){eval(fun)});
    });

    //重置容器高度
    function resizeContentHeight()
    {
        var winHeight     = $(window).height();
        var contentHeight = $('.page-content').outerHeight();
        var finnalHeight  = winHeight >= contentHeight ? winHeight : contentHeight;
        $('.page-content').css('height',finnalHeight);
        $('#sidebar').css('height',winHeight - 75);
    }

    //窗口大小调整触发
    window.onresize = resizeContentHeight;
    jQuery(function()
    {
        resizeContentHeight();
    });

    //获取左侧菜单项
    function matchLeftMenu(leftItem)
    {
        var matchObject = $('[name="leftMenu"]>li a[href="'+leftItem+'"]');
        if(matchObject.length > 0)
        {
            $.cookie('lastUrl', leftItem);
            return matchObject;
        }

        var lastUrl = $.cookie('lastUrl');
        if(lastUrl)
        {
            return $('[name="leftMenu"]>li a[href="'+lastUrl+'"]');
        }
        return null;
    }

    //左边栏菜单高亮
    var leftItem   = "<?php echo IUrl::getUri();?>";
    var matchObject = matchLeftMenu(leftItem);
    if(matchObject)
    {
        matchObject.parent().addClass('active').parent().collapse("show");
    }
	</script>
</body>
</html>